package cn.com.open.errorquestion.common;

import org.apache.log4j.Logger;
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;

import java.lang.reflect.Method;

/**
 * @author 奶茶
 * Created by on 2018/1/10.
 */
public class MyAsyncExceptionHandler implements AsyncUncaughtExceptionHandler{

    private static final Logger logger = Logger.getLogger(MyAsyncExceptionHandler.class);

    /**
     * 手动处理捕获的异常
     * @param ex
     * @param method
     * @param params
     */
    @Override
    public void handleUncaughtException(Throwable ex, Method method, Object... params) {
        logger.info("-------------》》》捕获线程异常信息");
        logger.info(method.getName() + "方法出现异常",ex);
    }

}
